//---------------------------------------------------------------------------
// CShellProcess
// Author : Woo-Hyun Kim
// Email : woorung@icu.ac.kr
// Date : Jul. 7, 2006
//---------------------------------------------------------------------------
#ifndef CShellProcessH
#define CShellProcessH

#include <iostream>
#include <iterator>
#include <vector>
#include <list>
#include <algorithm>
#include <fstream>
#include <string>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

#include "CProcess.h"

using namespace std;
//---------------------------------------------------------------------------
class CShellProcess : public CProcess {
protected:
        string command;

public :
        CShellProcess();
        CShellProcess(int verbose);
        CShellProcess(string &comm);
        CShellProcess(string &comm, int verbose);
	virtual ~CShellProcess();

        virtual int read_upstream(const char *buf); 
        virtual int read_downstream(const char *buf);
        virtual int read_errstream(const char *buf);
        virtual int read_upstream(const void *buf, size_t size); 
        virtual int read_downstream(const void *buf, size_t size);
        virtual int read_errstream(const void *buf, size_t size);

        string &get();
	void set(string &cmd);

        virtual void before_run();
        virtual void run();
};
//---------------------------------------------------------------------------
#endif
